package com.salatigacode.customerdatabase.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.salatigacode.customerdatabase.entity.Customer;

public class CustomerMapper implements RowMapper<Customer>{

	@Override
	public Customer mapRow(ResultSet rs, int rowNum) throws SQLException {
		Customer cust = new Customer();
		cust.setId(rs.getInt("id"));
		cust.setFirstName(rs.getString("firstname"));
		cust.setLastName(rs.getString("lastname"));
		cust.setPhone(rs.getString("phone"));
		cust.setEmail(rs.getString("email"));
		return cust;
	}

}
